<?php
class ValidationHelper
{
	public static function ValidateAllProperties($instance)
	{
		try 
		{
			$propertyErrors = array();
			//All Properties are mendatory.
			//Loop through and check for NULL. If NULL -> add name to property error list
			foreach($instance as $var => $value)
			{
				if(!isset($value))
				{
					$isValid = false;
					$this->AddPropertyError($var);
				}
			}
			return count($propertyErrors) > 0 ? $propertyErrors : null;
		}
		catch(Exception $exception)
		{
			throw new Exception("Error while validating object", "", $exception);	
		}
	}
}
?>